package com.sam.enumeration;

/**
 * 行星枚举的基本写法
 * @author Administrator
 *
 */
public enum Planet {

	EARTH(1, 2);

	private final double mass;

	private final double radius;

	private final double surfaceGravity;

	private static final double G = 6.67300E-11;

	private Planet(double mass, double radius) {
		this.mass = mass;
		this.radius = radius;
		surfaceGravity = G * mass / (radius * radius);
	}

	public double getMass() {
		return mass;
	}

	public double getRadius() {
		return radius;
	}

	public double getSurfaceGravity() {
		return surfaceGravity;
	}

	public double surfaceWeight(double mass) {
		return mass * surfaceGravity;
	}

}
